Skip to content

fix(portal): stop a long example response running over the previous and next page cards - #476

Merged
sohail2721 merged 2 commits into
devfrom
sohail/example-column-overlap
Nov 16, 2026
Merged

sohail2721 merged 2 commits into
devfrom
sohail/example-column-overlap

Conversation

@sohail2721

Copy link
Copy Markdown
Contributor

Point 2 of apimatic/apimatic-io#2350: on an operation page, a long "Example Response" ran over the page's previous and next cards.

What was wrong

Since fumadocs-openapi 12.6 the example column of an operation page is sticky and no taller than the window, and the cards in it are meant to shrink to fit. Ours could not. The layout we render around them was a plain block, so each card kept its full height, and a long response ran out of the bottom of the column and over the previous and next cards. Because the column is sticky, the end of that response could not be scrolled to either.

The fix

  • The layout (example-layout.tsx) takes the classes of Fumadocs' own default layout, flex min-h-0 flex-col, so the column's height reaches the cards.
  • The request card (usage-tabs.tsx) passes that height on at each box down to its code: the tabs, the open tab, the element marked for session replays, the block and its scroller. This is what Fumadocs' own request card does. With the layout change alone the overlap is gone, but our request card keeps its full height and the response card under a long sample is squeezed: to 131 px in a 1617 x 887 window, and to 44 px, its header only, at 1280 x 800.
  • The example selector loses mb-2. That margin used to collapse into the request card's own top margin; in a flex column it would add 8 px. The gap under the selector stays 16 px.

Below the width where the column sits beside the page, nothing changes: the column is not capped there, and both cards keep their height.

Pictures

A neutral spec with a long request body and a long response, built with portal generate.

Before, 1617 x 887, scrolled to the end of the page:

The response card over the previous and next cards

After, the same view:

Both cards inside the column, above the previous and next cards

After, 1280 x 800, at the top of the page:

Both cards sharing the column

Checked

Measured in headless Chrome on a portal built from this branch:

Window Before After
1617 x 887 cards of 636 and 642 px in a 799 px column: 511 px past it, over the footer cards 382 and 385 px, inside the column
1280 x 800 598 px past a 712 px column 338 and 342 px, inside the column
  • Each card's code scrolls inside its card.
  • The TypeScript tab shrinks the same way, and the closed tab stays hidden.
  • A page with the example selector fits its column too, with the same 16 px under the selector as before.
  • At 1000 px and 390 px wide, where the column sits under the page, both cards are 636 and 642 px, as before.
  • test/e2e/portal-build.test.ts, the "portal build (end to end)" fixture: 45 passing. That includes a new check of the built page's boxes, the existing cURL marker check, and the template's type-check.

I did not run the whole suite, and there is no browser test for this yet: the layout itself can only be held in apimatic/v4-test-automation.

The other points of the issue are not in this PR. Points 3 to 6 are Fumadocs' own and are reported as fuma-nama/fumadocs#3864 and fuma-nama/fumadocs#3865.

🤖 Generated with Claude Code

Muhammad Sohail and others added 2 commits November 16, 2026 15:38
…ious and next page cards

Since fumadocs-openapi 12.6 the example column of an operation page is sticky and
no taller than the window, and its cards are meant to shrink to fit it. Ours did
not: the layout around them was a plain block, so a long "Example Response" ran
out of the column, over the page's previous and next cards, and its end could not
be reached at all.

The layout now takes the classes of Fumadocs' own, and the request card passes the
column's height on at every box down to its code, as Fumadocs' request card does.
Without that the request card keeps its full height and the response card under a
long sample is squeezed to its header. Both cards now share the column and scroll
inside it. Below the width where the column sits beside the page, nothing changes.

The example selector loses a bottom margin that used to collapse into the card's
own, so the gap under it stays 16px.

Refs apimatic/apimatic-io#2350 (point 2)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ds shrink

Refs apimatic/apimatic-io#2350 (point 2)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sohail2721
sohail2721 merged commit 8e394e5 into dev Nov 16, 2026
14 checks passed
@sohail2721 sohail2721 mentioned this pull request Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants